<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="catalog" tagdir="/WEB-INF/tags/catalog"%>
<%@ taglib prefix="content" tagdir="/WEB-INF/tags/content"%>
 <probiz:ui_tabs tabsId="detail" />
<div class="top clearfix">
	<ul class="tab" id="detail">
		<li class="curr">
			<a href="#tab-summary"><span><fmt:message key="contentCategoryDetail.tab.summary" /> </span> </a>
		</li>
		<c:choose>
			<c:when test="${category.categoryType == 1 or empty category.categoryType}">
				<li>
					<a href="#tab-other"><span><fmt:message key="contentCategoryDetail.tab.other" /> </span> </a>
				</li>
				<verFunc:verFuncValidate funcKey="contentRelated4Category">
					<li>
						<a href="#tab-related"><span><fmt:message key="contentCategoryDetail.tab.related" /> </span> </a>
					</li>
				</verFunc:verFuncValidate>
			</c:when>
			<c:when test="${category.categoryType == 2}">
				<li>
					<a href="#tab-context"><span><fmt:message key="contentCategoryDetail.tab.context" /> </span> </a>
				</li>
				<li>
					<a href="#tab-other"><span><fmt:message key="contentCategoryDetail.tab.other" /> </span> </a>
				</li>
				<verFunc:verFuncValidate funcKey="contentRelated4Category">
					<li>
						<a href="#tab-related"><span><fmt:message key="contentCategoryDetail.tab.related" /> </span> </a>
					</li>
				</verFunc:verFuncValidate>
			</c:when>
			<c:otherwise>
				<li>
					<a href="#tab-linkInfo"><span><fmt:message key="contentCategoryDetail.tab.linkInfo" /> </span> </a>
				</li>
			</c:otherwise>
		</c:choose>
		
	</ul>
</div>
<div class="modify">
	<form id="contentCategoryForm" name="contentCategoryForm" action="${ctxPath}/content/contentCategory.html">
		<c:choose>
			<c:when test="${category.categoryType == 1 or empty category.categoryType}">
		        	<%@ include file="./include/contentCategoryFormSummary.jspf"%>
		        	<%@ include file="./include/contentCategoryFormSeoOther.jspf"%>
		        	<%@ include file="./include/contentCategoryFormRelated.jspf"%>
			</c:when>
			<c:when test="${category.categoryType == 2}">
		        	<%@ include file="./include/contentCategoryFormSummary.jspf"%>
		        	<%@ include file="./include/contentCategoryFormContext.jspf"%>
		        	<%@ include file="./include/contentCategoryFormSeoOther.jspf"%>
		        	<%@ include file="./include/contentCategoryFormRelated.jspf"%>
			</c:when>
			<c:otherwise>
		        	<%@ include file="./include/contentCategoryFormSummary.jspf"%>
		        	<%@ include file="./include/contentCategoryFormLinkInfo.jspf"%>
			</c:otherwise>
		</c:choose>
	</form>
</div>

<v:javascript formName="contentCategory" staticJavascript="false" />

<div style="display:none">
	<probiz:plugin_upload fileInputId="imageUrl" uploadFileTypes="gif,jpg" uploadCategory="category" onComplete="uploadCategoryImagehandler"/>
	<content:contentSelector selectorId="contentSelector" callbackFunc="selectRelatedContentCallback" multiple="true"/>
</div>	


<script type="text/javascript">
$j(document).ready(function () {
	displayButtons("${category.categoryId}","${category.categoryType}");
	initVariables();
	
	<%--start:初始化关联文章--%>
	<c:forEach items="${category.relatedContents}" var="rc">
		addManulContent({"id":"${rc.content.contentId}","contentTitle":"${rc.content.contentTitle}","imageUrl":"${rc.content.imageUrl}"},${rc.contentRelatedType.contentRelatedTypeId});
	</c:forEach>
	<%--end:初始化关联文章--%>
	
	//start:quickTip 生成 原因：在tag中$j无法扑捉到对象
	$j('[quickTip]').each(function(){
      	$j(this).after('<img id="'+this.id+'_tip" width="14" height="14" src="'+__ctxPath+'/images/validate/info.gif"/>');
		$j('#'+this.id+'_tip').PQuickTip({
	         source:'text',
	         title:'Help',
	         type:'help',
	         text:$j(this).attr("quickTip")
      	});
	
	});
	//end:quickTip 生成
	
	<%--start:sortable--%>
	<c:forEach items="${relatedTypeList}" var="relatedType">
		$j('#manualContentsDiv_${relatedType.contentRelatedTypeId}').sortable();
	</c:forEach>
	<%--end:  sortable--%>
});
</script>
